_base_ = [
    '../configs/deformable_detr/deformable_detr_r50_16x2_50e_coco.py',
]
# model settings
model = dict(bbox_head=dict(
    num_classes=5,
    with_box_refine=True,
))
# dataset
dataset_type = 'CocoDataset'
classes = ('1', '2', '3', '4', '5')
data_root = '/media/Store2/hlp/datasets/mmw'
img_norm_cfg = dict(
    mean=[18.87, 18.87, 18.87], std=[43.018, 43.018, 43.018], to_rgb=True)
train_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='LoadAnnotations', with_bbox=True),
    dict(type='RandomFlip', flip_ratio=0.5),
    dict(
        type='AutoAugment',
        policies=[
            [
                dict(
                    type='Resize',
                    img_scale=[(400, 160)],
                    multiscale_mode='value',
                    keep_ratio=True),
            ],
            [
                dict(
                    type='Resize',
                    img_scale=[(400, 160)],
                    multiscale_mode='value',
                    keep_ratio=True),
                dict(
                    type='RandomCrop',
                    crop_type='absolute_range',
                    crop_size=(100, 120),
                    allow_negative_crop=True),
                dict(
                    type='Resize',
                    img_scale=[(400, 160)],
                    multiscale_mode='value',
                    override=True,
                    keep_ratio=True),
            ],
        ]),
    dict(type='Normalize', **img_norm_cfg),
    dict(type='Pad', size_divisor=1),
    dict(type='DefaultFormatBundle'),
    dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
]
test_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(
        type='MultiScaleFlipAug',
        img_scale=(400, 160),
        flip=False,
        transforms=[
            dict(type='Resize', keep_ratio=True),
            dict(type='RandomFlip'),
            dict(type='Normalize', **img_norm_cfg),
            dict(type='Pad', size_divisor=1),
            dict(type='ImageToTensor', keys=['img']),
            dict(type='Collect', keys=['img'])
        ])
]
data = dict(
    samples_per_gpu=64,
    workers_per_gpu=2,
    train=dict(
        type=dataset_type,
        classes=classes,
        data_root=data_root,
        ann_file='annotations/train.json',
        img_prefix='images/',
        pipeline=train_pipeline),
    val=dict(
        type=dataset_type,
        classes=classes,
        data_root=data_root,
        ann_file='annotations/val.json',
        img_prefix='images/',
        pipeline=test_pipeline),
    test=dict(
        type=dataset_type,
        classes=classes,
        data_root=data_root,
        ann_file='annotations/test.json',
        img_prefix='images/',
        pipeline=test_pipeline))
evaluation = dict(interval=1, metric='bbox')
# optimizer
optimizer = dict(lr=2e-3)
